import request from '@/utils/request.js'

export const getProducts = (page, limit) => {
  return request({
    method: 'GET',
    url: '/products',
    params: {
      page,
      limit,
    }
  })
}

export const getProductDetail = productId => {
  return request({
    method: 'GET',
    url: `/product/detail/${productId}`
  })
}

export const getCommentsNum = (productId) => {
  return request({
    method: 'GET',
    url: `/reply/config/${productId}`,
  })
}

export const getCommentsByType = (productId, type) => {
  return request({
    method: 'GET',
    url: `/reply/list/${productId}`,
    params: {
      type,
    }
  })
}
